package com.example.springbootdatamock.util;/*
package com.example.springbootdatamock.util;


import com.example.springbootdatamock.mock.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

@Component
public class MockTask {
    @Value("${dataCount.mockCount}")
    private Integer mock_count;
    @Autowired
    ThreadPoolTaskExecutor taskExecutor;
    @Autowired
    private RedisMock redisMock;
    @Autowired
    private MysqlMocker mysqlMocker;
    @Autowired
    private CkMocker ckMocker;
    //       @Autowired
//       private HBaseMocker hBaseMocker;
//    @Autowired
//    private ESMocker esMocker;
    @Autowired
    private LogMocker logMocker;

    @Async
    public void mainTask() {
        for (int i = 0; i < this.mock_count.intValue(); i++) {
            this.taskExecutor.execute((Runnable) this.redisMock);
            this.taskExecutor.execute((Runnable) this.ckMocker);
//         this.taskExecutor.execute((Runnable)this.hBaseMocker);
//            this.taskExecutor.execute((Runnable) this.esMocker);
            this.taskExecutor.execute((Runnable) this.mysqlMocker);
            this.taskExecutor.execute((Runnable) this.logMocker);
        }

        while (true) {
            try {
                Thread.sleep(1000L);
                if (this.taskExecutor.getActiveCount() == 0) {
                    this.taskExecutor.destroy();
                    return;
                }
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}



 */
